
#include <BTextFormat>
#include "member_BTextFormat.h"

using namespace BWE;

#define member					(*(member_BTextFormat*)_ptr)
#define member_allocate()		_ptr = new member_BTextFormat(this)
#define member_release()		delete (member_BTextFormat*)_ptr

BTextFormat::BTextFormat()
{
	member_allocate();
}
BTextFormat::BTextFormat(const BString& name) : BObject(name)
{
	member_allocate();
}
BTextFormat::~BTextFormat()
{
	member_release();
}

BTextEdit* BTextFormat::textEdit() const
{
	return member.textEdit;
}
bool BTextFormat::fresh() const
{
	if (member.textEdit)
	{
		member.textEdit->fresh();
		return true;
	}
	return false;
}

const BFont* BTextFormat::font(int pos) const
{
	return 0;
}
const BColor* BTextFormat::back(int pos) const
{
	return 0;
}
const BColor* BTextFormat::color(int pos) const
{
	return 0;
}

int BTextFormat::indent(int line) const
{
	return -1;
}
int BTextFormat::lineHeight(int line) const
{
	return -1;
}
const BColor* BTextFormat::background(int line) const
{
	return 0;
}

void BTextFormat::attached(BTextEdit* textEdit)
{

}
void BTextFormat::detached(BTextEdit* textEdit)
{

}

bool BTextFormat::event(const BEvent& event)
{
	if (!member.textEdit)
		return false;

	bool over = false;
	switch (event.type())
	{
	case Event_Update:
		this->updateEvent(event);
		break;
	case Event_Focus:
		this->focusEvent(event);
		break;
	case Event_Move:
		this->moveEvent(event);
		break;
	case Event_Resize:
		this->resizeEvent(event);
		break;
	case Event_Adjust:
		this->adjustEvent(event);
		break;
	case Event_Style:
		this->styleEvent(event);
		break;
	case Event_Fresh:
		this->freshEvent(event);
		break;
	case Event_Paint:
		this->paintEvent(event);
		break;
	case Event_KeyDown:
		over = this->keyDownEvent((const BKeyEvent&)event);
		break;
	case Event_KeyUp:
		over = this->keyUpEvent((const BKeyEvent&)event);
		break;
	case Event_MouseEnter:
		over = this->mouseEnterEvent((const BMouseEvent&)event);
		break;
	case Event_MouseLeave:
		over = this->mouseLeaveEvent((const BMouseEvent&)event);
		break;
	case Event_MouseMove:
		over = this->mouseMoveEvent((const BMouseEvent&)event);
		break;
	case Event_MousePress:
		over = this->mousePressEvent((const BMouseEvent&)event);
		break;
	case Event_MouseRelease:
		over = this->mouseReleaseEvent((const BMouseEvent&)event);
		break;
	case Event_MouseClick:
		over = this->mouseClickEvent((const BMouseEvent&)event);
		break;
	case Event_DoubleClick:
		over = this->mouseDoubleClickEvent((const BMouseEvent&)event);
		break;
	case Event_MouseWheel:
		over = this->mouseWheelEvent((const BMouseEvent&)event);
		break;
	case Event_DragEnter:
		over = this->dragEnterEvent((const BDragEvent&)event);
		break;
	case Event_DragLeave:
		over = this->dragLeaveEvent((const BDragEvent&)event);
		break;
	case Event_DragMove:
		over = this->dragMoveEvent((const BDragEvent&)event);
		break;
	case Event_DragDrop:
		over = this->dragDropEvent((const BDragEvent&)event);
		break;
	default:
		break;
	}

	return over;
}

void BTextFormat::moveEvent(const BEvent& event)
{

}
void BTextFormat::resizeEvent(const BEvent& event)
{

}
void BTextFormat::updateEvent(const BEvent& event)
{

}
void BTextFormat::adjustEvent(const BEvent& event)
{

}

void BTextFormat::styleEvent(const BEvent& event)
{

}
void BTextFormat::freshEvent(const BEvent& event)
{

}
void BTextFormat::paintEvent(const BEvent& event)
{

}

bool BTextFormat::focusEvent(const BEvent& event)
{
	return false;
}
bool BTextFormat::keyDownEvent(const BKeyEvent& keyEvent)
{
	return false;
}
bool BTextFormat::keyUpEvent(const BKeyEvent& keyEvent)
{
	return false;
}

bool BTextFormat::mouseEnterEvent(const BMouseEvent& mouseEvent)
{
	return false;
}
bool BTextFormat::mouseLeaveEvent(const BMouseEvent& mouseEvent)
{
	return false;
}

bool BTextFormat::mousePressEvent(const BMouseEvent& mouseEvent)
{
	return false;
}
bool BTextFormat::mouseReleaseEvent(const BMouseEvent& mouseEvent)
{
	return false;
}
bool BTextFormat::mouseMoveEvent(const BMouseEvent& mouseEvent)
{
	return false;
}
bool BTextFormat::mouseWheelEvent(const BMouseEvent& mouseEvent)
{
	return false;
}

bool BTextFormat::mouseClickEvent(const BMouseEvent& mouseEvent)
{
	return false;
}
bool BTextFormat::mouseDoubleClickEvent(const BMouseEvent& mouseEvent)
{
	return false;
}

bool BTextFormat::dragEnterEvent(const BDragEvent& dragEvent)
{
	return false;
}
bool BTextFormat::dragLeaveEvent(const BDragEvent& dragEvent)
{
	return false;
}
bool BTextFormat::dragMoveEvent(const BDragEvent& dragEvent)
{
	return false;
}
bool BTextFormat::dragDropEvent(const BDragEvent& dragEvent)
{
	return false;
}
